//
//  CAnAlgExerData+Desc.m
//  CareRing
//
//  Created  on 2024/12/14.
//
    
#import <DateTools/DateTools.h>
#import "CAnAlgExerData+Desc.h"
#import "ConfigModel.h"

@implementation CAnAlgExerData (Desc)
-(NSString *)wholeDesc
{

    NSMutableString *infoString = [NSMutableString new];
    NSDate *date = [NSDate dateWithTimeIntervalSince1970:self.timeStamp];
    
    [infoString appendFormat:@"Date:%@, ", [date formattedDateWithFormat:_L2(L_DATE_FMT)]];
    
    [infoString appendFormat:@"Distance:%.2f Km,",self.distance];
    
    [infoString appendFormat:@"steps:%u,",self.steps];

    [infoString appendFormat:@"speed:%u dm/s,",self.speed];
    
    [infoString appendFormat:@"wholeEnergy:%u Kcal,",self.wholeEnergyCnsmptn];

    [infoString appendFormat:@"activityEnergy:%u Kcal,",self.activityEnergyCnsmptn];

    [infoString appendFormat:@"cadence:%u steps/min,",self.cadence];

    [infoString appendFormat:@"MET:%.2f MET,",self.met];

    [infoString appendFormat:@"Workout type: %@",[[self class] workoutTypeDesc:self.exerType]];
    [infoString appendFormat:@"heartRate:%u bpm,",self.heartRate];


    return infoString;
    
}


+(NSString *)workoutTypeDesc:(NALG_EXERCISE_TYPE)exerType
{
    NSString *str = @"";

    switch (exerType) {
       
        case     NALG_EXERCISE_OTHER : // Other
        {
            str = _L2(L_TX_OTHER);
        }
            break;
        case     NALG_EXERCISE_RUN: // Running
        {
            str = _L2(L_TX_RUNNING);
        }
            break;
        case     NALG_EXERCISE_WALK : // Walking
        {
            str = _L2(L_TX_WALK);
        }
            break;
        case     NALG_EXERCISE_POOL_SWIMING : // Pool Swimming
        {
            str = _L2(L_TX_POOLSWIM);
        }
            break;
        case     NALG_EXERCISE_OPEN_WATER_SWIM : // Open Water Swimming
        {
            str = _L2(L_TX_OP_W_SWIM);
        }
            break;
        case     NALG_EXERCISE_INDOOR_CYCLING : // Indoor Cycling
        {
            str = _L2(L_TX_INDOOR_CYCL);
        }
            break;
        case     NALG_EXERCISE_OUTDOOR_CYCLING : // Outdoor Cycling
        {
            str = _L2(L_TX_OUTDOOR_CYCL);
        }
            break;
        case     NALG_EXERCISE_YOGA : // Yoga
        {
            str = _L2(L_TX_UOGA);
        }
            break;
        case     NALG_EXERCISE_MINDFUL : // minful zhengnian
        {
            str = _L2(L_TX_MINDFUL);
        }
            break;
            
            
        default:
            break;
    }
    
    return str;
}

@end
